This invention relates to operating systems for digital computers and more particularly to a method for making files compatible between different digital computers having different binary structures but utilizing the same operating system.
There are many different digital computers available today. Indeed, it seems that the variety of different digital computers that are available is increasing and that there is little standardization of the architecture of the different digital computers. It is desirable for there to be compatibility between different digital computers at the level of the user's interaction with the computer, and hence there have emerged several operating systems which have been implemented on a number of different digital computer systems. These operating systems are refered to as "portable" operating systems and the process of implementing such a portable operating system on a new type of computer is refered to as "porting" or as "a port". The term "portable" will be used to refer to programs or data which can be used on more than one type of computer.
One such portable operating system is the UNIX operating system. UNIX is a trademark of Bell Labs. UNIX has been ported to a variety of very different computers, including mainframe IBM computers, minicomputers and microcomputers. Recently there have appeared several "UNIX like" operating systems which are compatible to one degree or another with UNIX at the user interface level, while their internal structure has been developed independently of the structure of the original UNIX. One such UNIX like operating system is COHERENT. COHERENT is a trademark of Mark Williams Company. This family of UNIX type operating systems, with the exception of COHERENT, has one feature which poses a serious portability problem, namely the incompatibility of files or file systems which have binary data within them if the source and destination computers have different binary structures.
One of the differences between computers is in the way binary data is structured. Binary data is data which is expressed as a binary or base two number, rather than being expressed in terms of an encoding of individual decimal digits, e.g. Binary Coded Decimal. The way this problem usually evidences itself is when groups of binary bits; for example bytes, each comprising eight bits; are combined to form larger binary quantities. When the groups of binary bits that are used by the computer are bytes of 8 bits, then the binary structure is refered to as a byte ordering, since the structure is fully described by the position of the bytes. As an example, let us consider a sixteen bit binary number stored in a computer which operates in bytes. Each sixteen bit number can be considered to be comprised of two bytes, a high order byte and a low order byte. There are many engineering considerations which determine the decision as to which order is chosen and the choice is not uniform from one computer to the next. The computer which is running an operating system will be refered to as the host computer and the binary structure of a particular computer will be refered to as its natural order. The natural order of the host computer determines the structure of binary data which is stored in the main memory of the host computer. In the prior art, the natural order of a computer also determined the binary structure for auxiliary memory files containing binary data, thereby making files and file systems incompatible between computers with different natural orders. A file system is a collection of files along with the directory information necessary to access the files. One particular example of a file containing binary data is an object file, which is a file created by a language translator, usually in the machine language of the host computer.
This incompatibility of files between different host computers has posed a serious problem in the prior art, as evidenced by the following quote from "The Bell System Technical Journal", VOL. 57, NO. 6, Part 2, July-August 1978, page 2039: "Another class of problems seems impossible to avoid, since it stems from the basic differences in the representation of information on the two machines. . . . Since all the interfaces between the two machines are byte-serial, the effect is best described by saying that when a true character stream is transmitted between them, all is well; but if intergers are sent, the bytes in each half-word must be swapped. Notice that this problem . . . complicates "protability" in its root meaning wherein files are carried from one machine to the other."
The following additional quote from p. 212 of "The C Programming Language" by Brian W. Kernighan and Dennis M. Ritchie, Prentice Hall, Inc., 1978, is further evidence of the nature of the problem in the prior art: "Purely hardware issues like word size and the properties of floating point arithmetic and integer division have proven in practice to be not much of a problem. Other facets of the hardware are reflected in differing implementations. Some of these, particularly sign extension (converting a negative character into a negative integer) and the order in which bytes are placed in a word, are a nuisance that must be carefully watched. Most of the others are only minor problems."
The problem of incompatibility of files between different host computers has been handled in the prior art by designing a conversion program to convert files from one natural order to another when it is necessary to transport files between different computer systems. This method is unsatisfactory because it introduces one additional decision and manual step into the process of transporting files, which can result in confusion and mistakes. This method is also unsatisfactory because it requires the writing of a different program for each different combination of computers between which files are to be transported.
One prior art method of transporting files from one computer system to another computer system with a different natural order can be better understood by looking at FIG. 1, which shows a computer A, 110, a computer B, 120, a computer C, 130, and an auxiliary memory, 140. A FILE1, 111, resides in the memory of Computer A, 110, in the natural order of Computer A, 110. When FILE1, 111, is written to Auxiliary Memory, 140, as FILE1, 141, it is in the same natural order of Computer A, 110. Similarly there is a FILE2, 121, in Computer B, 120, and a corresponding FILE2, 142, in Auxiliary Memory, 140, both in the natural order of Computer B, 120. There is also a FILE3, 131, in Computer C, 130, and a corresonding FILE3, 143, in Auxiliary Memory, 140, both in the natural order of Computer C, 130. In order to use this prior art method is necessary to have a conversion program in each computer system for converting from the natural order of every other possible computer system. In general, with n computer systems with different natural orders, it is necessary to have n times (n-1) such conversion programs. In addition to the necessity of having all of these conversion programs, it is necessary to keep track of what order each file is written in and to manually select the appropriate conversion program. It often occurs that little used conversion programs are not easily available when needed which can cause major problems with data transfer by this method.
It is an object of this invention to provide a method for using a canonical ordering of binary data to make files compatible between different host computers with different natural orders.